define(function(require,exports,module){
    var Base={
		mBaserSvrUrl:window.BaseServerUrl,
		localStorage:window.localStorage
	};
	
	function JlnRequest(){
		this.params={}
	}
	module.exports=DataGradeProxy;
function DataGradeProxy(){
	function datagradeSubmit(request, success, ignoreError) {
	    var url = Base.mBaserSvrUrl+'/datagrade';
        if (request.svr == null) request.svr = undefined;
	    if (request.token == null) request.token = undefined;
	    var content = JSON.stringify(request);
       
	    url = url + '?f=t&data=' + encodeURIComponent(content);
	    url = url + '&CallBack=?';
        $.getJSON(url,success);

	}

	function getFundGradesRq(union,investmentStrategy,productType,establishTime,togetherRating,incomeRating,normalRiskRating,extremeRiskRating,type,isAsc,page,countPerPage,order,success,ignoreError){
        var request=new JlnRequest();
        request.func='getFundGrades';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['is']=investmentStrategy;
		request.params['pt']=productType;
		request.params['et']=establishTime;
		request.params['tr']=togetherRating;
		request.params['ir']=incomeRating;
		request.params['nrr']=normalRiskRating;
		request.params['err']=extremeRiskRating;
		request.params['t']=type;
		request.params['ia']=isAsc;
		request.params['p']=page;
		request.params['cpp']=countPerPage;
		request.params['o']=order;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getFundGradesRequest=function(investmentStrategy,productType,establishTime,togetherRating,incomeRating,normalRiskRating,extremeRiskRating,type,isAsc,page,countPerPage,order,success,ignoreError){
       var request= getFundGradesRq(true,investmentStrategy,productType,establishTime,togetherRating,incomeRating,normalRiskRating,extremeRiskRating,type,isAsc,page,countPerPage,order,success,ignoreError);
       return request;
    }
	this.getFundGrades=function(investmentStrategy,productType,establishTime,togetherRating,incomeRating,normalRiskRating,extremeRiskRating,type,isAsc,page,countPerPage,order,success,ignoreError){
       var request= getFundGradesRq(false,investmentStrategy,productType,establishTime,togetherRating,incomeRating,normalRiskRating,extremeRiskRating,type,isAsc,page,countPerPage,order,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getProductNetsRq(union,SID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getProductNets';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['sid']=SID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getProductNetsRequest=function(SID,success,ignoreError){
       var request= getProductNetsRq(true,SID,success,ignoreError);
       return request;
    }
	this.getProductNets=function(SID,success,ignoreError){
       var request= getProductNetsRq(false,SID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getSiMuWangManagerBySIDRq(union,productSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getSiMuWangManagerBySID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['psid']=productSID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getSiMuWangManagerBySIDRequest=function(productSID,success,ignoreError){
       var request= getSiMuWangManagerBySIDRq(true,productSID,success,ignoreError);
       return request;
    }
	this.getSiMuWangManagerBySID=function(productSID,success,ignoreError){
       var request= getSiMuWangManagerBySIDRq(false,productSID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function SiMuWangCompanyBySIDRq(union,productSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='SiMuWangCompanyBySID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['psid']=productSID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.SiMuWangCompanyBySIDRequest=function(productSID,success,ignoreError){
       var request= SiMuWangCompanyBySIDRq(true,productSID,success,ignoreError);
       return request;
    }
	this.SiMuWangCompanyBySID=function(productSID,success,ignoreError){
       var request= SiMuWangCompanyBySIDRq(false,productSID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getManagerOtherFundGradesRq(union,productSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getManagerOtherFundGrades';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['psid']=productSID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getManagerOtherFundGradesRequest=function(productSID,success,ignoreError){
       var request= getManagerOtherFundGradesRq(true,productSID,success,ignoreError);
       return request;
    }
	this.getManagerOtherFundGrades=function(productSID,success,ignoreError){
       var request= getManagerOtherFundGradesRq(false,productSID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getCompanyOtherFundGradesRq(union,productSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getCompanyOtherFundGrades';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['psid']=productSID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getCompanyOtherFundGradesRequest=function(productSID,success,ignoreError){
       var request= getCompanyOtherFundGradesRq(true,productSID,success,ignoreError);
       return request;
    }
	this.getCompanyOtherFundGrades=function(productSID,success,ignoreError){
       var request= getCompanyOtherFundGradesRq(false,productSID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getFundIndexByTypeRq(union,Type,grade,success,ignoreError){
        var request=new JlnRequest();
        request.func='getFundIndexByType';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['t']=Type;
		request.params['g']=grade;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getFundIndexByTypeRequest=function(Type,grade,success,ignoreError){
       var request= getFundIndexByTypeRq(true,Type,grade,success,ignoreError);
       return request;
    }
	this.getFundIndexByType=function(Type,grade,success,ignoreError){
       var request= getFundIndexByTypeRq(false,Type,grade,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getPrivateFundGradeRq(union,SID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getPrivateFundGrade';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['sid']=SID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getPrivateFundGradeRequest=function(SID,success,ignoreError){
       var request= getPrivateFundGradeRq(true,SID,success,ignoreError);
       return request;
    }
	this.getPrivateFundGrade=function(SID,success,ignoreError){
       var request= getPrivateFundGradeRq(false,SID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getFundGradeBestListRq(union,limitNum,order,isAsc,success,ignoreError){
        var request=new JlnRequest();
        request.func='getFundGradeBestList';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['ln']=limitNum;
		request.params['o']=order;
		request.params['ia']=isAsc;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getFundGradeBestListRequest=function(limitNum,order,isAsc,success,ignoreError){
       var request= getFundGradeBestListRq(true,limitNum,order,isAsc,success,ignoreError);
       return request;
    }
	this.getFundGradeBestList=function(limitNum,order,isAsc,success,ignoreError){
       var request= getFundGradeBestListRq(false,limitNum,order,isAsc,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getPrivateFundGradeByIdRq(union,id,success,ignoreError){
        var request=new JlnRequest();
        request.func='getPrivateFundGradeById';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['id']=id;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getPrivateFundGradeByIdRequest=function(id,success,ignoreError){
       var request= getPrivateFundGradeByIdRq(true,id,success,ignoreError);
       return request;
    }
	this.getPrivateFundGradeById=function(id,success,ignoreError){
       var request= getPrivateFundGradeByIdRq(false,id,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getMaxPrivateFundGradeIdRq(union,success,ignoreError){
        var request=new JlnRequest();
        request.func='getMaxPrivateFundGradeId';
        request.token = Base.localStorage.getItem('request_token');
		
		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getMaxPrivateFundGradeIdRequest=function(success,ignoreError){
       var request= getMaxPrivateFundGradeIdRq(true,success,ignoreError);
       return request;
    }
	this.getMaxPrivateFundGradeId=function(success,ignoreError){
       var request= getMaxPrivateFundGradeIdRq(false,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getFundIndexBaseByTypeRq(union,type,success,ignoreError){
        var request=new JlnRequest();
        request.func='getFundIndexBaseByType';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['t']=type;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getFundIndexBaseByTypeRequest=function(type,success,ignoreError){
       var request= getFundIndexBaseByTypeRq(true,type,success,ignoreError);
       return request;
    }
	this.getFundIndexBaseByType=function(type,success,ignoreError){
       var request= getFundIndexBaseByTypeRq(false,type,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getFundIndexEntityByTypeRq(union,type,success,ignoreError){
        var request=new JlnRequest();
        request.func='getFundIndexEntityByType';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['t']=type;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getFundIndexEntityByTypeRequest=function(type,success,ignoreError){
       var request= getFundIndexEntityByTypeRq(true,type,success,ignoreError);
       return request;
    }
	this.getFundIndexEntityByType=function(type,success,ignoreError){
       var request= getFundIndexEntityByTypeRq(false,type,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getManagerFundGradesRq(union,SID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getManagerFundGrades';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['sid']=SID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getManagerFundGradesRequest=function(SID,success,ignoreError){
       var request= getManagerFundGradesRq(true,SID,success,ignoreError);
       return request;
    }
	this.getManagerFundGrades=function(SID,success,ignoreError){
       var request= getManagerFundGradesRq(false,SID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getCompanyFundGradesRq(union,SID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getCompanyFundGrades';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['sid']=SID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getCompanyFundGradesRequest=function(SID,success,ignoreError){
       var request= getCompanyFundGradesRq(true,SID,success,ignoreError);
       return request;
    }
	this.getCompanyFundGrades=function(SID,success,ignoreError){
       var request= getCompanyFundGradesRq(false,SID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getSiMuWangManagerByManagerSIDRq(union,managerSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getSiMuWangManagerByManagerSID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['msid']=managerSID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getSiMuWangManagerByManagerSIDRequest=function(managerSID,success,ignoreError){
       var request= getSiMuWangManagerByManagerSIDRq(true,managerSID,success,ignoreError);
       return request;
    }
	this.getSiMuWangManagerByManagerSID=function(managerSID,success,ignoreError){
       var request= getSiMuWangManagerByManagerSIDRq(false,managerSID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function SiMuWangCompanyByCompanySIDRq(union,companySID,success,ignoreError){
        var request=new JlnRequest();
        request.func='SiMuWangCompanyByCompanySID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['csid']=companySID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.SiMuWangCompanyByCompanySIDRequest=function(companySID,success,ignoreError){
       var request= SiMuWangCompanyByCompanySIDRq(true,companySID,success,ignoreError);
       return request;
    }
	this.SiMuWangCompanyByCompanySID=function(companySID,success,ignoreError){
       var request= SiMuWangCompanyByCompanySIDRq(false,companySID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getManagersByCompanySIDRq(union,companySID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getManagersByCompanySID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['csid']=companySID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getManagersByCompanySIDRequest=function(companySID,success,ignoreError){
       var request= getManagersByCompanySIDRq(true,companySID,success,ignoreError);
       return request;
    }
	this.getManagersByCompanySID=function(companySID,success,ignoreError){
       var request= getManagersByCompanySIDRq(false,companySID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }

	function getSiMuWangProductNetBySIDRq(union,productSID,success,ignoreError){
        var request=new JlnRequest();
        request.func='getSiMuWangProductNetBySID';
        request.token = Base.localStorage.getItem('request_token');
		
		request.params['psid']=productSID;

		if (union == true) {
	        request.svr = 'datagrade';
            request.ignoreError = ignoreError;
	        request.success = success;
        }
	    return request;
    }
	this.getSiMuWangProductNetBySIDRequest=function(productSID,success,ignoreError){
       var request= getSiMuWangProductNetBySIDRq(true,productSID,success,ignoreError);
       return request;
    }
	this.getSiMuWangProductNetBySID=function(productSID,success,ignoreError){
       var request= getSiMuWangProductNetBySIDRq(false,productSID,success,ignoreError);
       datagradeSubmit(request, success, ignoreError);

    }
}

});
